package ooday02;
//重写的调用：
public class OverrideDemo {
    public static void main(String[] args) {
        //重写方法被调用时，看对象的类型执行方法（new谁就调谁）
        Student zg = new Student("张光",23,"廊坊","jsd2304","001");
        zg.sayHi();//调用Student重写后的
        Teacher ll = new Teacher("李林",34,"佳木斯",6000);
        ll.sayHi();//调用的Teacher重写后的
        Doctor zl = new Doctor("张亮",45,"山东","心脑外科医生");
        zl.sayHi();//调用的person中的
    }
}
